﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example21.aspx.cs" Inherits="Chapter05.Example21" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 5-21 对象的相等和等同测试</title>
</head>
<body>
    <form>
        <div>
            <script type="text/javascript">
                var myData1 = {
                    name: "Adam",
                    weather: "sunny",
                };

                var myData2 = {
                    name: "Adam",
                    weather: "sunny",
                };

                var myData3 = myData2;

                var test1 = myData1 == myData2;
                var test2 = myData2 == myData3;
                var test3 = myData1 === myData2;
                var test4 = myData2 === myData3;

                document.writeln("Test 1: " + test1 + " Test 2: " + test2);
                document.writeln("Test 3: " + test3 + " Test 4: " + test4);
            </script>
        </div>
    </form>
</body>
</html>
